import type { ThemeConfig } from 'antd';

// 阿里云效风格主题配置
export const aliCloudTheme: ThemeConfig = {
  token: {
    // 主色调 - 阿里云蓝
    colorPrimary: '#1890ff',
    
    // 成功色
    colorSuccess: '#52c41a',
    
    // 警告色
    colorWarning: '#faad14',
    
    // 错误色
    colorError: '#ff4d4f',
    
    // 信息色
    colorInfo: '#1890ff',
    
    // 文字颜色
    colorText: '#262626',
    colorTextSecondary: '#8c8c8c',
    colorTextTertiary: '#bfbfbf',
    
    // 背景色
    colorBgContainer: '#ffffff',
    colorBgElevated: '#ffffff',
    colorBgLayout: '#f5f5f5',
    
    // 边框色
    colorBorder: '#d9d9d9',
    colorBorderSecondary: '#f0f0f0',
    
    // 圆角
    borderRadius: 6,
    borderRadiusLG: 8,
    borderRadiusSM: 4,
    
    // 字体
    fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
    fontSize: 14,
    fontSizeLG: 16,
    fontSizeSM: 12,
    
    // 行高
    lineHeight: 1.5715,
    lineHeightLG: 1.5,
    lineHeightSM: 1.66,
    
    // 间距
    padding: 16,
    paddingLG: 24,
    paddingSM: 12,
    paddingXS: 8,
    
    margin: 16,
    marginLG: 24,
    marginSM: 12,
    marginXS: 8,
    
    // 阴影
    boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',
    boxShadowSecondary: '0 1px 4px rgba(0, 0, 0, 0.12)',
    
    // 控件高度
    controlHeight: 32,
    controlHeightLG: 40,
    controlHeightSM: 24,
  },
  components: {
    // Layout 组件 - 阿里云效风格
    Layout: {
      headerBg: '#ffffff',
      headerHeight: 64,
      headerPadding: '0 24px',
      siderBg: '#f8f9fa',
      triggerBg: '#ffffff',
      triggerColor: '#1890ff',
    },
    
    // Menu 组件 - 阿里云效风格
    Menu: {
      itemBg: 'transparent',
      itemColor: '#666666',
      itemHoverBg: '#f5f5f5',
      itemHoverColor: '#1890ff',
      itemSelectedBg: 'linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%)',
      itemSelectedColor: '#1890ff',
      subMenuItemBg: 'transparent',
      groupTitleColor: '#8c8c8c',
    },
    
    // Card 组件
    Card: {
      headerBg: 'transparent',
      headerHeight: 56,
      actionsBg: '#fafafa',
    },
    
    // Table 组件
    Table: {
      headerBg: '#fafafa',
      headerColor: '#262626',
      rowHoverBg: '#f5f5f5',
      borderColor: '#f0f0f0',
    },
    
    // Button 组件
    Button: {
      primaryShadow: '0 2px 0 rgba(5, 145, 255, 0.1)',
      dangerShadow: '0 2px 0 rgba(255, 77, 79, 0.1)',
    },
    
    // Form 组件
    Form: {
      labelColor: '#262626',
      labelRequiredMarkColor: '#ff4d4f',
      itemMarginBottom: 24,
    },
    
    // Input 组件
    Input: {
      hoverBorderColor: '#40a9ff',
      activeBorderColor: '#1890ff',
    },
    
    // Select 组件
    Select: {
      optionSelectedBg: '#e6f7ff',
      optionActiveBg: '#f5f5f5',
    },
    
    // Pagination 组件
    Pagination: {
      itemActiveBg: '#1890ff',
      itemLinkBg: '#ffffff',
      itemInputBg: '#ffffff',
    },
    
    // Modal 组件
    Modal: {
      headerBg: '#ffffff',
      contentBg: '#ffffff',
      footerBg: '#ffffff',
    },
    
    // Drawer 组件
    Drawer: {
      colorBgElevated: '#ffffff',
    },
    
    // Tabs 组件
    Tabs: {
      itemColor: '#8c8c8c',
      itemHoverColor: '#1890ff',
      itemSelectedColor: '#1890ff',
      inkBarColor: '#1890ff',
      cardBg: '#fafafa',
    },
    
    // Badge 组件
    Badge: {
      colorBgContainer: '#ff4d4f',
      textFontSize: 12,
    },
    
    // Tag 组件
    Tag: {
      defaultBg: '#fafafa',
      defaultColor: '#262626',
    },
    
    // Progress 组件
    Progress: {
      defaultColor: '#1890ff',
      remainingColor: '#f5f5f5',
    },
    
    // Statistic 组件
    Statistic: {
      titleFontSize: 14,
      contentFontSize: 24,
    },
    
    // Result 组件
    Result: {
      titleFontSize: 24,
      subtitleFontSize: 14,
      iconFontSize: 72,
    },
    
    // Empty 组件
    Empty: {
      colorTextDisabled: '#bfbfbf',
    },
    
    // Spin 组件
    Spin: {
      colorPrimary: '#1890ff',
    },
    
    // BackTop 组件
    BackTop: {
      colorBgElevated: '#ffffff',
      colorText: '#1890ff',
    },
    
    // Anchor 组件
    Anchor: {
      linkPaddingBlock: 4,
      linkPaddingInlineStart: 16,
    },
    
    // Breadcrumb 组件
    Breadcrumb: {
      itemColor: '#8c8c8c',
      lastItemColor: '#262626',
      linkColor: '#1890ff',
      linkHoverColor: '#40a9ff',
      separatorColor: '#8c8c8c',
    },
    
    // Steps 组件
    Steps: {
      colorPrimary: '#1890ff',
      colorText: '#262626',
      colorTextDescription: '#8c8c8c',
    },
    
    // Timeline 组件
    Timeline: {
      dotBg: '#ffffff',
      dotBorderWidth: 2,
      itemPaddingBottom: 20,
    },
    
    // Rate 组件
    Rate: {
      starColor: '#fadb14',
      starBg: '#f0f0f0',
    },
    
    // Upload 组件
    Upload: {
      colorBgMask: 'rgba(0, 0, 0, 0.5)',
      actionsColor: '#ffffff',
    },
    
    // Calendar 组件
    Calendar: {
      itemActiveBg: '#e6f7ff',
      fullBg: '#ffffff',
      fullPanelBg: '#ffffff',
    },
    
    // DatePicker 组件
    DatePicker: {
      cellActiveWithRangeBg: '#e6f7ff',
      cellHoverWithRangeBg: '#f5f5f5',
      cellRangeBorderColor: '#1890ff',
    },
    
    // TimePicker 组件
    TimePicker: {
      cellHoverBg: '#f5f5f5',
      columnHeight: 224,
      columnWidth: 56,
    },
    
    // Slider 组件
    Slider: {
      railBg: '#f5f5f5',
      railHoverBg: '#e1e1e1',
      trackBg: '#1890ff',
      trackHoverBg: '#40a9ff',
      handleColor: '#1890ff',
      handleActiveColor: '#096dd9',
      dotBorderColor: '#1890ff',
      dotActiveBorderColor: '#096dd9',
    },
    
    // Switch 组件
    Switch: {
      colorPrimary: '#1890ff',
      colorPrimaryHover: '#40a9ff',
    },
    
    // Checkbox 组件
    Checkbox: {
      colorPrimary: '#1890ff',
      colorPrimaryHover: '#40a9ff',
    },
    
    // Radio 组件
    Radio: {
      colorPrimary: '#1890ff',
      colorPrimaryHover: '#40a9ff',
      dotColorDisabled: '#d9d9d9',
    },
  },
};

export default aliCloudTheme;
